home *** CD-ROM | disk | FTP | other *** search
/ Aminet 30 / Aminet 30 (1999)(Schatztruhe)[!][Apr 1999].iso / Aminet / gfx / board / P96Speed.lha / P96Speed / InstallP96Speed < prev    next >
Text File  |  1999-02-04  |  16KB  |  510 lines

  1. ;-----------------------------------------------------------------------------
  2. ; Script to install P96Speed v1.0+
  3. ;
  4. ; $VER: InstallP96Speed 1.3 (04.02.99)
  5. ;
  6. ; - done by Jens Langner (htw10895@informatik.htw-dresden.de)
  7. ;
  8. ;-----------------------------------------------------------------------------
  9.  
  10. ;=============================================================================
  11. ; Configuration defaults
  12. ;=============================================================================
  13.  
  14. (set #Name                    "P96Speed")
  15. (set #MinSysVersion            36)
  16. (set #LibsDefaultPath        "SYS:Libs")
  17. (set #MainPath                "P96Speed")
  18. (set #MainDefaultPath        "Work:")
  19.  
  20. ;=============================================================================
  21. ; English strings
  22. ;=============================================================================
  23.  
  24. (if
  25.     (= @language "english")
  26.     (
  27.     ; startup message
  28.         (set #StartUpMsg     "Do you want to read the documentations now ?")
  29.         (set #StartUpMsgHelp "You should read the documentations now to check if your system is compatible with P96Speed!")
  30.         
  31.     ; Errors
  32.         (set #Err-Bad-Kick "You need at least KickStart 2.0 to run P96Speed!")
  33.         (set #Err-Bad-CPU "You need at least a Motorola M68020 CPU to run P96Speed")
  34.  
  35.     ; Warnings
  36.  
  37.     ; Message
  38.         (set #Message
  39.             (cat
  40.                 "\nThank you very much for choosing P96Speed as your Speedcomparsion system.\n\n\n"
  41.                 "P96Speed is the new GFX benchmark program for ALL graphicsystems.\n\n\nInstallscript ©`1997-99 by Jens Langner\n\n"
  42.             )
  43.         )
  44.  
  45.     ; Install/Update
  46.         (set #InstallMode "Do you want to install or uninstall P96Speed?")
  47.         (set #InstallModeHelp
  48.             (cat
  49.                 "Choosing Install will install P96Speed with all needed libraries,"
  50.                 "if you click uninstall, this script will remove your installed P96Speed version."
  51.             )
  52.         )
  53.         (set #Install "Install")
  54.  
  55.         (set #UnPrg   "Main programs & Docs")
  56.         (set #UnLib   "Libraries")
  57.  
  58.         (set #Uninstall     "Uninstall an installed version")
  59.         (set #UninstallSel  "What do you want to uninstall ?")
  60.         (set #UninstallSelHelp
  61.             (cat
  62.                 "Here you can select what you want to remove from your P96Speed installation."
  63.             )
  64.         )
  65.         (set #AskUninstall  "Do you really want to uninstall the selected areas?")
  66.         (set #AskUnyes      "Yes!")
  67.         (set #AskUnno       "No!")
  68.         (set #AskUninstallHelp
  69.             (cat
  70.                 "If the installer will find any backups of a old installation before P96Speed,"
  71.                 "it will reinstall them."
  72.             )
  73.         )
  74.  
  75.         (set #InstEnd
  76.             (cat "\nThe installation is finished now and the installer hopefully copied all packages to the right place.\n"
  77.                  "If you still got any problems, please check the following Webpages for help:\n\n"
  78.                  "http://p96speed.home.pages.de/\n\nor mail to: Jens Langner <htw10895@informatik.htw-dresden.de>\n\n"
  79.                  "Thank you very much for choosing P96Speed\n\nYour P96Speed Author...."
  80.             )
  81.         )
  82.         (set #UniEnd
  83.             (cat "\nThe uninstall procedure is finished now and hopefully all selected packages are correctly removed.\n"
  84.                  "If you got any problems, please check the following Webpages for help:\n\n"
  85.                  "http://p96speed.home.pages.de/\n\nor mail to: Jens Langner <htw10895@informatik.htw-dresden.de>\n\n"
  86.                  "Thank you very much for trying P96Speed. And we hope you soon will install it again.\n\nYour P96Speed Author...."
  87.             )
  88.         )
  89.  
  90.     ; Libs
  91.         (set #AskLibPath    "Where do you want to have the P96Speed library files installed?")
  92.         (set #AskLibPathUp  "Where do you have the P96Speed library files installed?")
  93.         (set #AskLibPathHelp
  94.             (cat
  95.                 "If you are not absolutely sure what to choose, choose \""
  96.                 #LibsDefaultPath "\"!"
  97.             )
  98.         )
  99.         (set #AskLibPathLibs #LibsDefaultPath)
  100.         (set #AskLibPathUser "Select another location")
  101.  
  102.         (set #SelectLibDir "Choose a directory for the P96Speed library files.")
  103.         (set #SelectLibDirUp "Choose the directory where you installed the files.")
  104.         (set #SelectLibDirHelp
  105.             (cat
  106.                 "This directory MUST be a part of your LIBS: assign!"
  107.                 "It has to be part of libs: before the monitors are launched."
  108.                 "Therefore, it is usually best to install them in SYS:libs."
  109.             )
  110.         )
  111.  
  112.     ; Main
  113.         (set #AskMainPath   "Where do you want to have the Main program files installed?")
  114.         (set #AskMainPathUp "Where are the program files installed?")
  115.         (set #AskMainPathHelp
  116.             (cat
  117.                 "If you are not absolutely sure what to choose, choose \"SYS:"
  118.                 #MainPath "\"!"
  119.             )
  120.         )
  121.         (set #AskMainPathDevs (cat "SYS:" #MainPath))
  122.         (set #AskMainPathUser "Select another location")
  123.  
  124.         (set #SelectMainDir     "Where do you want to have the main program files installed?\nA drawer named P96Speed will be created there.")
  125.         (set #SelectMainDirUp   "Where do you have the support files installed?")
  126.         (set #SelectMainDirHelp
  127.             (cat
  128.                 "A new drawer named P96Speed will be created to hold the files."
  129.                 "An appropriate assign will be added to your user-startup file later."
  130.             )
  131.         )
  132.  
  133.     ; Copy
  134.         (set #P96SpeedHomeDir       "Creating drawer for applications and scripts.")
  135.         (set #P96SpeedHomeDirHelp   "The drawer created now holds the applications and the update and uninstall scripts.")
  136.         (set #CopyGTLayout          "Installing gtlayout.library.")
  137.         (set #CopyGTLayoutHelp      "This library is needed for P96Speed.\nAuthor: Olaf 'Olsen' Barthel")
  138.         (set #CopyIdentify          "Installing identify.library.")
  139.         (set #CopyIdentifyHelp      "This library is needed for P96Speed.\nAuthor: Richard Koerber")
  140.     
  141.         (set #CopyMain              "Installing Main program.")
  142.         (set #CopyMainHelp          "Here the main program will be installed to its path.")
  143.         (set #CopyMainDoc           "Installing the documentation")
  144.         (set #CopyMainDocHelp       "Here the documentation will be installed to its path.")
  145.  
  146.     ; Install
  147.         (set #Msg-Installing "Installing P96Speed files!")
  148.  
  149.     )
  150. )
  151.  
  152. ;=============================================================================
  153. ; German strings
  154. ;=============================================================================
  155.  
  156. (if
  157.     (= @language "deutsch")
  158.     (
  159.     ; startup message
  160.         (set #StartUpMsg     "Möchten Sie nun die Dokumentation lesen ?")
  161.         (set #StartUpMsgHelp "Sie sollten nun die Dokumentation lesen um zu kontrollieren ob Ihr System mit P96Speed kompatible ist!")
  162.         
  163.     ; Errors
  164.         (set #Err-Bad-Kick "Sie benötigen mindestens KickStart 2.0 für P96Speed!")
  165.         (set #Err-Bad-CPU "Sie benötigen mindestens eine Motorola M68020 CPU für P96Speed!")
  166.  
  167.     ; Warnings
  168.  
  169.     ; Message
  170.         (set #Message
  171.             (cat
  172.                 "\nVielen Dank, daß Sie P96Speed installieren wollen.\n\n\n"
  173.                 "P96Speed ist das neue Grafik Benchmarkprogramm für ALLE Grafiksysteme.\n\n\nInstallskript ©`1997-99 - Jens Langner\n\n"
  174.             )
  175.         )
  176.  
  177.     ; Install/Update
  178.         (set #InstallMode "Wollen Sie P96Speed installieren oder entfernen?")
  179.         (set #InstallModeHelp
  180.             (cat
  181.                 "Wenn Sie Installieren wählen, wird P96Speed mit allen Libraries installiert,"
  182.                 "wenn Sie Enfernen wählen, können Sie auswählen was Sie deinstallieren wollen."
  183.             )
  184.         )
  185.         (set #Install "Installation")
  186.  
  187.         (set #UnPrg   "Hauptprogramm mit Dokumentation")
  188.         (set #UnLib   "Zusatzbibliotheken")
  189.  
  190.         (set #Uninstall     "Bestehende Installation entfernen")
  191.         (set #UninstallSel  "Was möchten Sie entfernen ?")
  192.         (set #UninstallSelHelp
  193.             (cat
  194.                 "Sie können nun wählen welche Teile der Installation Sie löschen möchten."
  195.             )
  196.         )
  197.         (set #AskUninstall  "Möchten Sie wirklich die von Ihnen gewählten Bereiche löschen?")
  198.         (set #AskUnyes      "Ja!")
  199.         (set #AskUnno       "Nein!")
  200.         (set #AskUninstallHelp
  201.             (cat
  202.                 "Wenn der Installer irgendwelche gesicherten Dateiene finden sollte, die vor"
  203.                 "der P96Speed existierten, wird er diese an den alten Platz zurückkopieren."
  204.             )
  205.         )
  206.  
  207.         (set #InstEnd
  208.             (cat "\nDie Installation ist nun abgeschlossen und der Installer hat hoffentlich alles an den richtigen Platz kopiert.\n"
  209.                  "Wenn Sie dennoch Probleme haben sollten, finden Sie auf folgenden WebSeiten Hilfe:\n\n"
  210.                  "http://p96speed.home.pages.de/\n\noder schreiben Sie an: Jens Langner <htw10895@informatik.htw-dresden.de>\n\n"
  211.                  "Danke das Sie P96Speed gewählt haben.\n\nIhr P96Speed Author...."
  212.             )
  213.         )
  214.         (set #UniEnd
  215.             (cat "\nDie Deinstallation is nun abgeschlossen und hoffentlich sind alle gewählten Pakete korrekt entfernt worden.\n"
  216.                  "Wenn Sie Probleme haben sollten, finden Sie auf folgenden WebSeiten Hilfe:\n\n"
  217.                  "http://p96speed.home.pages.de/\n\noder schreiben Sie an: Jens Langner <htw10895@informatik.htw-dresden.de>\n\n"
  218.                  "Danke das Sie P96Speed benutzt haben. Wir hoffen Sie wählen es einmal wieder.\n\n"
  219.                  "Ihr P96Speed Author...."
  220.             )
  221.         )
  222.  
  223.     ; Libs
  224.         (set #AskLibPath    "Wo sollen die Zusatzbibliotheken für P96Speed installiert werden?")
  225.         (set #AskLibPathUp  "Wo sind die Zusatzbibliotheken von P96Speed installiert?")
  226.         (set #AskLibPathHelp
  227.             (cat
  228.                 "Die Funktionsbibliotheken müssen in das Verzeichnis kopiert werden, auf welches "
  229.                 "der Assign Libs: während des Startvorgangs (vor User-Startup!) zeigt. "
  230.                 "Im Zweifelsfall nehmen Sie einfach " #LibsDefaultPath "!"
  231.             )
  232.         )
  233.         (set #AskLibPathLibs #LibsDefaultPath)
  234.         (set #AskLibPathUser "Einen anderen Ort wählen")
  235.  
  236.         (set #SelectLibDir      "Wählen Sie ein Verzeichnis für die Zusatzbibliotheken von P96Speed.")
  237.         (set #SelectLibDirUp    "Wählen Sie das Verzeichnis mit den Zusatzbibliotheken von P96Speed.")
  238.         (set #SelectLibDirHelp
  239.             (cat
  240.                 "Dieses Verzeichnis MUSS ein Teil Ihrer LIBS: Zuweisung sein!"
  241.                 "Am Besten, die Dateien in SYS:Libs installieren."
  242.             )
  243.         )
  244.  
  245.     ; Main
  246.         (set #AskMainPath   "Wo soll das Hauptprogramm und die Dokumentation installiert werden?")
  247.         (set #AskMainPathUp "Wo ist das Hauptprogramm mit der Dokumentation installiert?")
  248.         (set #AskMainPathHelp
  249.             (cat
  250.                 "Wenn Sie sich nicht absolut sicher sind, wählen Sie \"SYS:"
  251.                 #MainPath "\"!"
  252.             )
  253.         )
  254.         (set #AskMainPathDevs (cat "SYS:" #MainPath))
  255.         (set #AskMainPathUser "Einen anderen Ort wählen")
  256.  
  257.         (set #SelectMainDir     "Wo soll das Hauptprogramm und die Dokuemntation installiert werden?\nEin neues Verzeichnis mit Namen P96Speed wird dort installiert.")
  258.         (set #SelectMainDirUp   "Wo ist das Hauptprogramm mit der Dokumentation installiert worden?")
  259.         (set #SelectMainDirHelp
  260.             (cat
  261.                 "Dort wird das Hauptprogramm 'P96Speed' mit samt der Dokumentation installiert."
  262.             )
  263.         )
  264.  
  265.     ; Copy
  266.         (set #P96SpeedHomeDir       "P96Speed Stammverzeichnis wird angelegt.")
  267.         (set #P96SpeedHomeDirHelp   "Das angelegte Verzeichnis beherbergt das Zubehör.")
  268.         (set #CopyGTLayout          "Installation der GTLayout.library.")
  269.         (set #CopyGTLayoutHelp      "Diese Bibliothek wird für das GUI von P96Speed benötigt.\nAuthor: Olaf 'Olsen' Barthel")
  270.         (set #CopyIdentify          "Installation der Identify.library.")
  271.         (set #CopyIdentifyHelp      "Diese Bibliothek wird für die Systemerkennung von P96Speed benötigt.\nAuthor: Richard Koerber")
  272.     
  273.         (set #CopyMain              "Installation des Hauptprogrammes.")
  274.         (set #CopyMainHelp          "In diesem Schritt wird das Hauptprogramm installiert.")
  275.         (set #CopyMainDoc           "Installation der Dokumentation.")
  276.         (set #CopyMainDocHelp       "In diesem Schritt wird die Dokumentation installiert.")
  277.  
  278.     ; Install
  279.         (set #Msg-Installing "Installiere P96Speed System!")
  280.  
  281.     )
  282. )
  283.  
  284.  
  285. ;=============================================================================
  286. ; Procedures
  287. ;=============================================================================
  288.  
  289. (procedure GetLibPath
  290.  
  291.     (if
  292.         (askbool
  293.             (if (= #_installmode 0) (prompt #AskLibPath))
  294.             (if (= #_installmode 1) (prompt #AskLibPathUp))
  295.             (help #AskLibPathHelp)
  296.             (choices #AskLibPathLibs #AskLibPathUser)
  297.         )
  298.         (set #_libpath #LibsDefaultPath)
  299.         (set #_libpath
  300.             (askdir
  301.                 (if (= #_installmode 0) (prompt #SelectLibDir))
  302.                 (if (= #_installmode 1) (prompt #SelectLibDir))
  303.                 (help #SelectLibDirHelp)
  304.                 (default #LibsDefaultPath)
  305.                 (disk)
  306.             )
  307.         )
  308.     )
  309. )
  310.  
  311. (procedure GetMainPath
  312.  
  313.        (if
  314.         (askbool
  315.             (if (= #_installmode 0) (prompt #AskMainPath))
  316.             (if (= #_installmode 1) (prompt #AskMainPathUp))
  317.             (help #AskMainPathHelp)
  318.                (choices #AskMainPathDevs #AskMainPathUser)
  319.         )
  320.         ((if (= #_installmode 0) (set #_mainpathroot "SYS:"))
  321.         (if (= #_installmode 1) (set #_mainpathroot (cat "SYS:" #MainPath))))
  322.         (set #_mainpathroot
  323.             (askdir
  324.                 (if (= #_installmode 0) (prompt #SelectMainDir))
  325.                 (if (= #_installmode 1) (prompt #SelectMainDirUp))
  326.                 (help #SelectMainDirHelp)
  327.                 (default #MainDefaultPath)
  328.                 (newpath)
  329.                 (disk)
  330.             )
  331.         )
  332.     )
  333.     (if (= #_installmode 0) (set #_mainpath (tackon #_mainpathroot #MainPath)))
  334.     (if (= #_installmode 1) (set #_mainpath (cat #_mainpathroot)))
  335.  
  336. )
  337.  
  338. (procedure CopyLibs
  339.  
  340.       ; copy gtlayout.library
  341.     (copylib
  342.         (prompt #CopyGTLayout)
  343.         (help #CopyGTLayoutHelp)
  344.         (source "libs/gtlayout.library")
  345.         (dest #_libpath)
  346.         (confirm 0)
  347.     )
  348.  
  349.     ; copy identify.library
  350.     (copylib
  351.         (prompt #CopyIdentify)
  352.         (help #CopyIdentifyHelp)
  353.         (source "libs/identify.library")
  354.         (dest #_libpath)
  355.         (confirm 0)
  356.     )
  357.  
  358. )
  359.  
  360. (procedure CopyMain
  361.  
  362.     (copyfiles
  363.         (prompt #CopyMain)
  364.         (help #CopyMainHelp)
  365.         (source "")
  366.         (dest #_mainpath)
  367.         (infos)
  368.         (all)
  369.     )
  370.  
  371. )
  372.  
  373. ;=============================================================================
  374. ; Install ...
  375. ;=============================================================================
  376.  
  377. (message #Message)
  378.  
  379. (if
  380.     (< (getversion) (* #MinSysVersion 65536))
  381.     (abort #Err-Bad-Kick)
  382. )
  383.  
  384. (set #_installmode
  385.     (askchoice
  386.         (prompt #InstallMode)
  387.         (help #InstallModeHelp "\n\n" @askoptions-help)
  388.         (choices
  389.             #Install
  390.             #Uninstall
  391.         )
  392.         (default 0)
  393.     )
  394. )
  395.  
  396. (welcome)
  397.  
  398. ;*********************
  399.  
  400. (if
  401.     (= #_installmode 0)
  402.     (
  403.         ;*******************
  404.         ; adviceing user
  405.  
  406.         (set #_olduserlevel @user-level)
  407.         (user 1)
  408.         (if
  409.             (askbool
  410.                 (prompt    #StartupMsg)
  411.                 (help        #StartupMsgHelp)
  412.             )
  413.             (
  414.                 (if
  415.                     (= @language "english")
  416.                     (
  417.                         (run "Copy P96Speed.guide RAM:" (safe))
  418.                         (run "SYS:Utilities/MultiView RAM:P96Speed.guide" (safe))
  419.                     )
  420.                 )
  421.                 (if
  422.                     (= @language "deutsch")
  423.                     (
  424.                         (run "Copy P96Speed.guide RAM:" (safe))
  425.                         (run "SYS:Utilities/MultiView RAM:P96Speed.guide" (safe))
  426.                     )
  427.                 )
  428.             )
  429.         )
  430.         (user #_olduserlevel)
  431.  
  432.         ;*********************
  433.         ; install
  434.     
  435.  
  436.         ;*********************
  437.         ; get paths
  438.  
  439.  
  440.         (GetLibPath)
  441.         (GetMainPath)
  442.  
  443.         ;*********************
  444.         ; finally install...
  445.  
  446.         (working #Msg-Installing)
  447.  
  448.         (set @default-dest #_mainpath)
  449.  
  450.         ; make applications directory
  451.         (if
  452.             (= 0 (exists #_mainpath))
  453.             (makedir #_mainpath
  454.                 (prompt #P96SpeedHomeDir)
  455.                 (help #P96SpeedHomeDirHelp)
  456.                 (confirm 0)
  457.                 (infos)
  458.             )
  459.         )
  460.  
  461.         ; Copy MainPrg & Doc
  462.  
  463.         (CopyMain)
  464.  
  465.         ; Copy Libraries
  466.  
  467.         (CopyLibs)
  468.  
  469.     (message #InstEnd)
  470.     )
  471. )
  472.  
  473. (if
  474.     (= #_installmode 1)
  475.     (
  476.     
  477.  
  478.     (set #_uninstall
  479.         (askoptions
  480.                (prompt #UninstallSel)
  481.             (help #UninstallSelHelp)
  482.             (choices
  483.                 #UnPrg
  484.                 #UnLib
  485.             )
  486.             (default 1)
  487.         )
  488.     )
  489.  
  490.     (if
  491.         (askbool
  492.             (prompt #AskUninstall)
  493.             (help #AskUninstallHelp)
  494.             (choices #AskUnyes #AskUnno)
  495.         )
  496.         (set #_uninstallyes 0)
  497.         (set #_uninstallyes 1)
  498.     )
  499.     
  500.     (if (= #_uninstallyes 0)(
  501.         (if (BITAND #_uninstall 1)             (GetMainPath))
  502.         (if (BITAND #_uninstall 2)             (GetLibPath))
  503.  
  504.         (if (BITAND #_uninstall 1)             (run (cat 'delete "' #_mainpath '" "' #_mainpath '.info" ALL')))
  505.         (if (BITAND #_uninstall 2)             (delete (tackon #_libpath "gtlayout.library") (tackon #_libpath "identify.library"))))
  506.     )
  507.     (message #UniEnd)
  508.     )
  509. )
  510.